

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.ico">
  <link rel="icon" href="/img/favicon.ico">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="
什么是 Hexo？
Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用Markdown（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。

安装前提应用程序：

Nodejs
github
vscode [^mark]

[^mark]: &amp;lt;&amp;lt;用作编辑markdown，根据个人喜好，比如mdpad&amp;gt;&amp;gt;">
  <meta name="author" content="kinzun">
  <meta name="keywords" content>
  <meta name="description" content="什么是 Hexo？ Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用Markdown（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。  安装前提应用程序：  Nodejs github vscode [^mark]  [^mark]: &amp;lt;&amp;lt;用作编辑markdown，根据个人喜好，比如mdpad&amp;gt;&amp;gt;">
<meta name="keywords" content="hexo">
<meta property="og:type" content="article">
<meta property="og:title" content="GitHub Hexo Blog">
<meta property="og:url" content="https://kinzun.github.io/2017/05/17/hexodep/index.html">
<meta property="og:site_name" content="kinzun">
<meta property="og:description" content="什么是 Hexo？ Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用Markdown（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。  安装前提应用程序：  Nodejs github vscode [^mark]  [^mark]: &amp;lt;&amp;lt;用作编辑markdown，根据个人喜好，比如mdpad&amp;gt;&amp;gt;">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://kinzun.github.io/images/githexo.png">
<meta property="og:image" content="https://kinzun.github.io/images/snipaste_20170517_161507.png">
<meta property="og:image" content="https://kinzun.github.io/images/hexonext.png">
<meta property="og:image" content="https://kinzun.github.io/images/snipaste_20170517_171942.png">
<meta property="og:image" content="https://kinzun.github.io/images/snipaste_20170517_170651.png">
<meta property="og:updated_time" content="2021-10-10T11:50:48.072Z">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="GitHub Hexo Blog">
<meta name="twitter:description" content="什么是 Hexo？ Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用Markdown（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。  安装前提应用程序：  Nodejs github vscode [^mark]  [^mark]: &amp;lt;&amp;lt;用作编辑markdown，根据个人喜好，比如mdpad&amp;gt;&amp;gt;">
<meta name="twitter:image" content="https://kinzun.github.io/images/githexo.png">
  
  <title>GitHub Hexo Blog - kinzun</title>

  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css">


  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css">
  <link rel="stylesheet" href="/lib/hint/hint.min.css">

  
    
    
      
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css">
    
  

  
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css">
  


<!-- 主题依赖的图标库，不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">

<link rel="stylesheet" href="/css/main.css">

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"kinzun.github.io","root":"/","version":"1.8.12","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname"}},"search_path":"/local-search.xml"};
  </script>
  <script src="/js/utils.js"></script>
  <script src="/js/color-schema.js"></script>
</head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>kinzun</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="GitHub Hexo Blog">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2017-05-17 18:02" pubdate>
        2017年5月17日 晚上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.8k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      9 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">GitHub Hexo Blog</h1>
            
            <div class="markdown-body">
              <p><img src="/images/githexo.png" srcset="/img/loading.gif" lazyload alt="githexo"></p>
<h3 id="什么是-Hexo？"><a href="#什么是-Hexo？" class="headerlink" title="什么是 Hexo？"></a>什么是 <a href="https://hexo.io/zh-cn/docs/index.html" target="_blank" rel="noopener">Hexo</a>？</h3><blockquote>
<p>Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用<a href="http://daringfireball.net/projects/markdown/" target="_blank" rel="noopener">Markdown</a>（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。</p>
</blockquote>
<h3 id="安装前提"><a href="#安装前提" class="headerlink" title="安装前提"></a>安装前提</h3><p>应用程序：</p>
<ul>
<li><a href="https://nodejs.org/en/" target="_blank" rel="noopener">Nodejs</a></li>
<li><a href="https://git-scm.com/" target="_blank" rel="noopener">github</a></li>
<li><a href="https://code.visualstudio.com/" target="_blank" rel="noopener">vscode</a> [^mark]</li>
</ul>
<p>[^mark]: &lt;&lt;用作编辑markdown，根据个人喜好，比如<a href="http://www.markdownpad.com/" target="_blank" rel="noopener">mdpad</a>&gt;&gt;</p>
<a id="more"></a>
<h3 id="配置npm镜像源"><a href="#配置npm镜像源" class="headerlink" title="配置npm镜像源"></a>配置npm镜像源</h3><blockquote>
<p>npm全称Node Package Manager，是node.js的模块依赖管理工具。</p>
</blockquote>
<p>由于npm的源在国外，配置源以淘宝源为例：</p>
<ul>
<li><p>临时使用</p>
<figure class="highlight coffeescript"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-built_in">npm</span> --registry https:<span class="hljs-regexp">//</span>registry.<span class="hljs-built_in">npm</span>.taobao.org install express<br></code></pre></div></td></tr></table></figure>
</li>
<li><p>持久使用</p>
<figure class="highlight gams"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">npm config <span class="hljs-keyword">set</span> registry <span class="hljs-comment">https:</span>//<span class="hljs-comment">registry.npm.taobao.org</span><br></code></pre></div></td></tr></table></figure>
</li>
</ul>
<blockquote>
<h6 id="配置后可通过下面方式来验证是否成功"><a href="#配置后可通过下面方式来验证是否成功" class="headerlink" title="// 配置后可通过下面方式来验证是否成功"></a>// 配置后可通过下面方式来验证是否成功</h6></blockquote>
<figure class="highlight routeros"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">npm<span class="hljs-built_in"> config </span><span class="hljs-builtin-name">get</span> registry<br></code></pre></div></td></tr></table></figure>
<figure class="highlight nginx"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-attribute">npm</span> <span class="hljs-literal">info</span> express<br></code></pre></div></td></tr></table></figure>
<ul>
<li>通过cnpm使用</li>
</ul>
<figure class="highlight coffeescript"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-built_in">npm</span> install -g cnpm --registry=https:<span class="hljs-regexp">//</span>registry.<span class="hljs-built_in">npm</span>.taobao.org<br></code></pre></div></td></tr></table></figure>
<blockquote>
<h6 id="使用cnpm-install-expresstall-express"><a href="#使用cnpm-install-expresstall-express" class="headerlink" title="// 使用cnpm install expresstall express"></a>// 使用cnpm install expresstall express</h6></blockquote>
<h2 id><a href="#" class="headerlink" title></a><img src="/images/snipaste_20170517_161507.png" srcset="/img/loading.gif" lazyload alt="taobao"></h2><h3 id="安装-Hexo"><a href="#安装-Hexo" class="headerlink" title="安装 Hexo"></a>安装 Hexo</h3><figure class="highlight shell"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs shell"><span class="hljs-meta">$</span><span class="bash"> npm install -g hexo-cli</span><br></code></pre></div></td></tr></table></figure>
<p>#-g表示全局安装, npm默认为当前b安装</p>
<h3 id="npm-基本指令"><a href="#npm-基本指令" class="headerlink" title="npm 基本指令"></a>npm 基本指令</h3><figure class="highlight routeros"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">- 卸载全局安装模块  npm uninstall -g &lt;package&gt;<br><br>卸载后，你可以到去全局安装目录查看/node_modules/ 目录下查看包是否还存在，或者使用以下命令查看：npm ls<br><br>- 获取全局安装目录 npm<span class="hljs-built_in"> config </span><span class="hljs-builtin-name">get</span><span class="hljs-built_in"> prefix<br></span><br>- 查看所有全局安装的模块 npm ls -g<br><br>- 查看npm默认设置（部分） npm<span class="hljs-built_in"> config </span>ls<br><br>- 查看npm默认设置（全部） npm<span class="hljs-built_in"> config </span>ls -l<br></code></pre></div></td></tr></table></figure>
<p>npm指令英文文档，如 ：<a href="https://docs.npmjs.com/" target="_blank" rel="noopener">https://docs.npmjs.com</a></p>
<p>如需了解更多 <a href="https://docs.npmjs.com/getting-started/what-is-npm" target="_blank" rel="noopener">npm docs page</a></p>
<h3 id="问题"><a href="#问题" class="headerlink" title="问题"></a>问题</h3><p>若在安装中遇到，提供的页面中有常见安装问题。</p>
<p>如果遇到相同问题，移步<a href="https://github.com/hexojs/hexo/issues/2569" target="_blank" rel="noopener">472</a></p>
<figure class="highlight shell"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs shell">module.js:472<br>    throw err;<br>    ^<br><br>Error: Cannot find module 'D:\Program Files\Git\node_modules\hexo-cli\bin\hexo'<br></code></pre></div></td></tr></table></figure>
<ul>
<li><p><a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="noopener">hexo issues</a></p>
</li>
<li><p><a href="http://wp.huangshiyang.com/hexo%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88" target="_blank" rel="noopener">huangshiyuang常见问题</a></p>
</li>
<li><p><a href="http://www.jianshu.com/p/67c57c70f275" target="_blank" rel="noopener">hexo 部署至Git遇到的坑</a></p>
</li>
</ul>
<h3 id="hexo-建立默认站点"><a href="#hexo-建立默认站点" class="headerlink" title="hexo 建立默认站点"></a>hexo 建立默认站点</h3><p>在我的电脑中建立一个名字叫「Hexo」的文件夹，然后在此文件夹中右键打开Git Bash。执行</p>
<figure class="highlight shell"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-meta">$</span><span class="bash"> hexo init</span><br></code></pre></div></td></tr></table></figure>
<p>如果无法使用右击“Git Bash”，则可以切换到指定目录</p>
<figure class="highlight shell"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-meta">$</span><span class="bash"> <span class="hljs-built_in">cd</span> i:/hexo</span><br></code></pre></div></td></tr></table></figure>
<p>安装依赖包Hexo随后会自动生产建立网站所需的文件</p>
<figure class="highlight shell"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-meta">$</span><span class="bash"> npm install</span><br></code></pre></div></td></tr></table></figure>
<p>开启预览访问端口（默认端口4000，’ctrl + c’关闭server）可选开启调试模式（即加上 –debug）</p>
<figure class="highlight nginx"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-attribute">hexo</span> s --<span class="hljs-literal">debug</span> <span class="hljs-comment">#调试模式</span><br>hexo server<br></code></pre></div></td></tr></table></figure>
<p>然后到浏览器输入localhost:4000。</p>
<p>一个默认的本地hexo站点完成。</p>
<p><img src="/images/hexonext.png" srcset="/img/loading.gif" lazyload alt="hexo"></p>
<h3 id="hexo切换主题"><a href="#hexo切换主题" class="headerlink" title="hexo切换主题"></a>hexo切换主题</h3><ul>
<li>安装主题</li>
</ul>
<p>Hexo 安装只需要将主题文件拷贝至站点目录的 themes 目录下， 然后修改下配置文件即可。</p>
<p>在 Hexo 中有两份主要的配置文件，其名称都是 _config.yml。 </p>
<p>_config.yml 位于站点根目录下</p>
<p><img src srcset="/img/loading.gif" lazyload alt></p>
<ul>
<li>启用主题</li>
</ul>
<p>打开 _config.yml 找到 theme 字段 ，修改值为主题</p>
<figure class="highlight autoit"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">theme: <span class="hljs-keyword">next</span><br></code></pre></div></td></tr></table></figure>
<p><img src="/images/snipaste_20170517_171942.png" srcset="/img/loading.gif" lazyload alt="theme"></p>
<p>在切换主题之后、验证之前， 我们最好使用 hexo clean 来清除 Hexo 的缓存。</p>
<ul>
<li>验证主题</li>
</ul>
<figure class="highlight ebnf"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-attribute">hexo s</span><br></code></pre></div></td></tr></table></figure>
<p>此时即可使用浏览器访问 <a href="http://localhost:4000，检查站点是否正确运行。" target="_blank" rel="noopener">http://localhost:4000，检查站点是否正确运行。</a></p>
<h3 id="部署到github"><a href="#部署到github" class="headerlink" title="部署到github"></a>部署到github</h3><ul>
<li>安装 hexo-deployer-git。</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">npm <span class="hljs-keyword">install</span> hexo-deployer-git <span class="hljs-comment">--save</span><br></code></pre></div></td></tr></table></figure>
<ul>
<li>修改主配置文件_config.yml,</li>
</ul>
<figure class="highlight less"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-attribute">deploy</span>:<br>  <span class="hljs-attribute">type</span>: git<br>  <span class="hljs-attribute">repo</span>: git<span class="hljs-variable">@github</span>.<span class="hljs-attribute">com</span>:kinzun/kinzun.github.io.git<br>  <span class="hljs-attribute">branch</span>: master<br>  # <span class="hljs-attribute">message</span>: [message]<br></code></pre></div></td></tr></table></figure>
<p><img src="/images/snipaste_20170517_170651.png" srcset="/img/loading.gif" lazyload alt="deploy"></p>
<ul>
<li>生成静态文件</li>
</ul>
<figure class="highlight verilog"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">hexo <span class="hljs-keyword">generate</span><br></code></pre></div></td></tr></table></figure>
<ul>
<li>快速部署</li>
</ul>
<figure class="highlight ebnf"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-attribute">hexo deployer</span><br></code></pre></div></td></tr></table></figure>
<p>同时执行，两条作用相同。</p>
<figure class="highlight verilog"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">hexo <span class="hljs-keyword">generate</span> --deploy <br>hexo deploy --<span class="hljs-keyword">generate</span><br></code></pre></div></td></tr></table></figure>
<ul>
<li>每次需要写博客可以使用</li>
</ul>
<figure class="highlight ebnf"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><span class="hljs-attribute">hexo n</span><br></code></pre></div></td></tr></table></figure>
<p>soure文件夹下的_post文件夹下新建一个markdown文件.</p>
<figure class="highlight vbnet"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined"><br>    首先我们需要检查你电脑上现有的ssh <span class="hljs-keyword">key</span>：<br>$ cd ~/. ssh 检查本机的ssh密钥<br>    如果提示：No such file <span class="hljs-keyword">or</span> directory 说明你是第一次使用git。<br>    生成新的SSH <span class="hljs-keyword">Key</span>：<br>$ ssh-keygen -t rsa -C <span class="hljs-string">"邮件地址@youremail.com"</span><br>Generating <span class="hljs-keyword">public</span>/<span class="hljs-keyword">private</span> rsa <span class="hljs-keyword">key</span> pair.<br>Enter file <span class="hljs-keyword">in</span> which <span class="hljs-keyword">to</span> save the <span class="hljs-keyword">key</span> <br>(/Users/your_user_directory/.ssh/id_rsa):&lt;回车就好&gt;<br></code></pre></div></td></tr></table></figure>
<p>.ssh/id_rsa.pub<br> 登陆github系统。点击右上角的 Account Settings—&gt;SSH Public keys —&gt; add another public keys</p>
<p><strong>注意</strong> 将私钥权限 设置 700 其他人无法访问即可。</p>
<figure class="highlight verilog"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">chmod <span class="hljs-number">700</span> id_rsa<br>测试<br>$ ssh -T git@github<span class="hljs-variable">.com</span><br><br>Hi cnfeat! You've successfully authenticated, <br>but GitHub does <span class="hljs-keyword">not</span> provide shell access.<br><br>验证成功<br><br>进行下一步，配置全局<br><br>$ git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> user<span class="hljs-variable">.name</span> <span class="hljs-string">"cnfeat"</span><span class="hljs-comment">//用户名</span><br>$ git <span class="hljs-keyword">config</span> --<span class="hljs-keyword">global</span> user<span class="hljs-variable">.email</span> <span class="hljs-string">"cnfeat@gmail.com"</span><span class="hljs-comment">//填写自己的邮箱</span><br><br>SSH Key配置成功，本机已成功连接到github<br></code></pre></div></td></tr></table></figure>
<h3 id="hexo-常用命令"><a href="#hexo-常用命令" class="headerlink" title="hexo 常用命令"></a>hexo 常用命令</h3><figure class="highlight axapta"><table><tr><td class="gutter hljs"><div class="hljs code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></div></td><td class="code"><div class="hljs code-wrapper"><pre><code class="hljs undefined">hexo <span class="hljs-keyword">new</span> <span class="hljs-string">"postName"</span> <span class="hljs-meta">#新建文章</span><br>hexo <span class="hljs-keyword">new</span> page <span class="hljs-string">"pageName"</span> <span class="hljs-meta">#新建页面</span><br>hexo generate <span class="hljs-meta">#生成静态页面至public目录</span><br>hexo <span class="hljs-keyword">server</span> <span class="hljs-meta">#开启预览访问端口（默认端口4000，'ctrl + c'关闭server）</span><br>hexo deploy <span class="hljs-meta">#将.deploy目录部署到GitHub</span><br>hexo help <span class="hljs-meta">#查看帮助</span><br>hexo version <span class="hljs-meta">#查看Hexo的版本</span><br></code></pre></div></td></tr></table></figure>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><p><a href="https://hexo.io/zh-cn/docs/" target="_blank" rel="noopener">hexo 官方文档</a></p>
<p><a href="http://theme-next.iissnan.com/" target="_blank" rel="noopener">NEXT 主题文档 </a></p>
<p><a href="https://luuman.github.io/categories/Hexo/" target="_blank" rel="noopener">世平阜康</a></p>
<p><a href="http://www.jianshu.com/p/e99ed60390a8" target="_blank" rel="noopener">hexo搭建github博客</a></p>
<p><a href="http://artori.us/git-github-usage/" target="_blank" rel="noopener">Git/Github使用方法小记</a></p>
<p><a href="http://www.voidking.com/2015/05/30/deve-hexo-build-environment/" target="_blank" rel="noopener"></a></p>
<p><a href="https://docs.npmjs.com/getting-started/installing-node" target="_blank" rel="noopener">Node.js Docs</a></p>
<p><a href="http://www.jianshu.com/p/1e402922ee32/" target="_blank" rel="noopener">Markdown——入门指南</a></p>
<p><a href="http://www.jianshu.com/p/82e730892d42" target="_blank" rel="noopener">Markdown的常用语法</a></p>
<p><a href="https://sanwen8.cn/p/670KuHA.html" target="_blank" rel="noopener">Markdown|让文本更加精致</a></p>
<p><a href="https://www.zhihu.com/question/24422335" target="_blank" rel="noopener">主题推荐</a></p>
<p><a href="http://www.jianshu.com/p/701b1095da11" target="_blank" rel="noopener">手把手教你建github技术博客</a></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/主题博客/">主题博客</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/hexo/">hexo</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2017/05/18/zabbixInstalldeploy/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">zabbix安装部署</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2017/05/16/keepalived/">
                        <span class="hidden-mobile">Keeplaived 高可用nginx负载均衡</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
              <!-- Comments -->
              <article class="comments" id="comments" lazyload>
                
                  
                
                

              </article>
            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
